package com.example.demo.entity;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;
import org.springframework.ldap.odm.annotations.Attribute;
import org.springframework.ldap.odm.annotations.Entry;
import org.springframework.ldap.odm.annotations.Id;

import javax.naming.Name;

@Data
@Entry(objectClasses = "person")
public class Person {
    @Id
    @JsonSerialize(using = ToStringSerializer.class)
    private Name dn;

    @Attribute(name = "cn")
    private String name;

    @Attribute(name = "sAMAccountName")
    private String account;

    @Attribute(name = "mail")
    private String email;

    @Attribute(name = "userAccountControl")
    protected String status;

    @Attribute(name = "givenName")
    private String givenName;

    @Attribute(name = "sn")
    private String lastName;

    @Attribute(name = "telephoneNumber")
    private String telephoneNumber;

    @Attribute(name = "userPrincipalName")
    private String userPrincipalName;

}
